package com.loongtech.bi.manager.game;

import com.loongtech.bi.entity.game.EntityRoleActivityJoinRate;
import com.loongtech.core.jpa.manager.ManagerQueryCacheBase;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RoleActivityJoinRateManager extends ManagerQueryCacheBase<EntityRoleActivityJoinRate> {
	private static final long serialVersionUID = 1L;

	public List<EntityRoleActivityJoinRate> getDatas(Date dayStart, Date dayEnd, String queryPlatform, String queryChannel, String queryServer, String activityType, List<String> activities) {
		return findByQuery("from EntityRoleActivityJoinRate where " +
                "day>=:dayStart and day<=:dayEnd and platformid=:queryPlatform and channelid=:queryChannel and serverid=:queryServer and " +
                "activitytype=:activityType and activityid in (:activityids) order by day, activityid ",
                "dayStart", dayStart, "dayEnd", dayEnd, "queryPlatform", queryPlatform, "queryChannel", queryChannel, "queryServer", queryServer, "activityType", activityType, "activityids", activities);
	}

    public List<EntityRoleActivityJoinRate> getDatasByVipLevel(Date dayStart, Date dayEnd,String queryPlatform, String queryChannel, String queryServer, String activityType, List<String> activities, List<Integer> viplevels) {
        return findByQuery("from EntityRoleActivityJoinRate where " +
                  "day>=:dayStart and day<=:dayEnd and platformid=:queryPlatform and channelid=:queryChannel and serverid=:queryServer and " +
                  "activitytype=:activityType and activityid in (:activityids) and viplevel in (:viplevels) order by day, activityid ",
                  "dayStart", dayStart, "dayEnd", dayEnd, "queryPlatform", queryPlatform, "queryChannel", queryChannel, "queryServer", queryServer, "activityType", activityType, "activityids", activities, "viplevels", viplevels);
    }
}
